<?php abstract class Views {
	const Dir = 'FLCL5/views';

	protected static function Exists ($View) {return (file_exists ($FName = self::Dir."/$View.php")) ? $FName : FALSE;}
	public static function Suggest ($View) {self::Exists ($View) and XReq::Write ('next', $View);}
	public static function Render () {
		$View = XReq::FetchDrop ('next') or $View = Auth::DefaultView ();
		if ($FName = self::Exists ($View)) {
			if (Auth::Permission ('view', $View)) {
				require_once ($FName);
			} else echo ("<p>access denied</p>");
		} else echo ("<p>view '$View' definition not found</p>");
	}

} ?>